﻿using System;
using Interfaces.BusinessLogic;
using Interfaces.FilterModels;
using Interfaces.Filters;
using Interfaces.Models;
using Interfaces.Providers;

namespace BusinessLogic.Services.Operations
{
    public class FeedOperationService : IFeedOperationService
    {
        private readonly INewsDataProvider<IFeed, IFilter> _newsDataProvider;
        private readonly INewsFilter<INewsFilterModel> _filter;  
        
        public FeedOperationService(INewsDataProvider<IFeed, IFilter> newsDataProvider, 
                                    INewsFilter<INewsFilterModel> filter)
        {
            _newsDataProvider = newsDataProvider;
            _filter = filter;
        }

        public IFeed GetDataByUrl(string url, INewsFilterModel filterModel)
        {
            _filter.FilterModel = filterModel;
            return _newsDataProvider.GetData(url, _filter);
        }

        public void AddToFavorite(Guid userId, Guid itemId)
        {
            throw new NotImplementedException();
        }

        public void RemoveFromFavorite(Guid userId, Guid itemId)
        {
            throw new NotImplementedException();
        }
    }
}
